<input type="button" onclick=testFunction()> 这段代码错在哪里了,谢谢!
来源:百度知道 编辑:UC知道 时间:2024/06/05 00:57:34
<input type="button" onclick=testFunction()>
<script>
testFunction()
{
var str = "dfjakja 334 adjfakjf 3l jlfajfl";
str = str.replace(/\d+/g, 'abc'); //str 就是结果了
alert(str);
}
</script>
<script>
testFunction()
{
var str = "dfjakja 334 adjfakjf 3l jlfajfl";
str = str.replace(/\d+/g, 'abc'); //str 就是结果了
alert(str);
}
</script>
你写的没错,错在你没在方法声明
在testFunction()前面加个方法声明就行了:
function testFunction(){...}
<script>
function testFunction()
{
var str = "dfjakja 334 adjfakjf 3l jlfajfl";
str = str.replace(/\d+/g, 'abc'); //str 就是结果了
alert(str);
}
</script>
<input type="button" onclick=testFunction()>
这样写就行了
<script>
function test()
{
var str = "dfjakja 334 adjfakjf 3l jlfajfl";
str = str.replace(/\d+/g, 'abc'); //str 就是结果了
alert(str);
}
</script>
<input type="button" value="button" onclick="test()">
<INPUT class=input_val type=password
关于<input type=radio>的问题???
<input type="image" src="...">看看这个代码
<input type=file name=filename>能初始化里边的值吗?
jsp问题<input type="hidden" datafld="userId" />
要使用 <input type="text"> 里填写的数据作为参数
<input type="image">图片按钮怎么做成有提交的功能??
<input type="image" 网页表单提交的”怪“问题?高手进!!
福州至贵阳货物托运,运费怎么个算?><input type=
<input type="textarea" >输入满一行怎样自动换行?